package com.example.dddsample.application.assembler;

import com.example.dddsample.application.api.response.CustomerResponseDTO;
import com.example.dddsample.application.assembler.mapper.CustomerMapper;
import com.example.dddsample.application.assembler.mapper.CustomerRequestDTOMapper;
import com.example.dddsample.domain.entity.CustomerAggregate;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author: bebm
 * @date: 2022/3/29 15:07
 * @description:
 */
@Component
public class CustomerRequestDTOAssembler {

    public CustomerAggregate assemblerFromCustomerAggregate
            (CustomerResponseDTO customerAggregate){
        return CustomerRequestDTOMapper.INST.fromCustomerResponseDTO(customerAggregate);
    }

    public List<CustomerAggregate> assemblerFromCustomerAggregate
            (List<CustomerResponseDTO> list){
        return CustomerRequestDTOMapper.INST.fromCustomerResponseDTOList(list);
    }
}
